<template>
<div class="search">
   <el-input placeholder="请输入内容" v-model="value" class="input-with-select">
    <el-select slot="prepend" v-model="type" placeholder="请选择">
      <el-option label="学生姓名" value="studentName"></el-option>
      <el-option label="性别" value="gender"></el-option>
      <el-option label="年龄" value="age"></el-option>
    </el-select>
    <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
  </el-input>
  </div>
</template>

<script>
import {mapActions} from 'vuex'
export default {
    data(){
        return {
            type:"",
            value:""
        }
    },
    methods:{
        search(){
            let {type,value} = this;
            // this.$emit('show',{type,value})
            this.show({type,value});
            // this.$emit({type:this.type,value:this.value});
        },
        
        ...mapActions("student",["show"])
    }
}
</script>

<style>
    .search{
        width:500px;
    }
</style>